﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登陆</title>
<link rel="Shortcut Icon" href="logo.ico"  />
<link href="css/style.css" type="text/css" rel="stylesheet" />
<script src="js/jquery-1.12.4.js" type="text/javascript"></script>
<script type="text/javascript">
function login() {
	 var nn=$("#zhm").val();
	var jj=$("#mm").val();
	if (nn==""||nn==null) {
		alert("账户名不能为空");
		return false;
	}else if(jj==""||jj==null){
		alert("密码不能为空");
		return false;
	}else{
		
		$.post("../Easy_Easy_City_First_End/login",
				{"opr":"login","name":nn,"pwd":jj},
			function(data){
				if (data.result!="0") {
					alert("登录成功");
					//用户ID
					 var userId=data.result;
					  $.post("../Easy_Easy_City_First_End/login",
							{"opr":"checkLoginInfo","userId":userId},
						function(data){
							if (data.result=="1") {
								location.href="product_show.jsp";
							} else {
								location.href="member.jsp";
							}
						},"json");  
				} else {
					alert("登录失败");
				} 
			},"json");
	} 
}
	
</script>

</head>
<body class="member">
	<input id="userId" type="hidden" value="${sessionScope.login.id}"/>
	<div class="w1185">
    	<div class="logo"><a href="#"></a></div>
        <div class="font-d">欢迎登陆</div>
        <div class="search">
        	<form action="#" class="form">
        		<input type="text" value="输入商品关键字" name="keyword" class="txt" onfocus="if(value=='输入商品关键字') {value=''}" onblur="if(value=='') {value='输入商品关键字'}"/>
                <input type="submit" value="搜索" class="sub"/>
            </form>
        	<p><a href="#">iphone6s</a>|<a href="#">面膜</a>|<a href="#">婚庆床品</a>|<a href="#">运动鞋</a>|<a href="#">眼霜</a>|<a href="#">月饼</a>|<a href="#">智能手机</a>|<a href="#">连衣裙</a></p>
        </div>
        <div class="s_r"><img src="images/tel.jpg"/></div>
        <div class="clear"></div>
    </div>

<div class="m_bg">
	<div class="w1185"><!-- onfocus="if(value=='账户名') {value=''}" onblur="if(value=='') {value='账户名'}" -->
    	<form  class="form"><!-- onfocus="if(value=='密码') {value=''}" onblur="if(value=='') {value='密码'} -->
        	<p class="p01"><span>会员登录</span><a href="reg.jsp">免费注册</a></p>
        	<p class="p02"><input type="text" id="zhm" value="" name="name" class="txt" /></p>
            <p class="p03"><input type="password" id="mm" value="" name="pwd" class="txt" /></p>
            <p class="p04"><span class="sp01"><input type="checkbox" name=""/>自动登录</span><span class="sp02">忘记密码？点击<a href="#">找回密码</a></span></p>
            <p class="p05"><input type="button" id="smt" value="立即登陆" class="sub" onclick="login()"/></p>
            <p class="p06">使用合作网站账号登录：</p>
            <p class="p07"><a href="#" class="a01"></a><a href="#" class="a02"></a><a href="#" class="a03"></a></p>
        </form>
    </div>
</div>

<div class="bottom">
	<a href="#">关于我们</a>|<a href="#">帮助中心</a>|<a href="#">法律声明</a>|<a href="#">用户协议</a>|<a href="#">联系我们</a>|<a href="#">人才招聘</a>|<a href="#">站点地图</a>
   
    <p>网络文化经营许可证：粤网文[2015]0295-065号<br />© 2015 深圳易易城科技网络有限公司. 粤ICP备15042543号</p>
</div>
</body>
</html>
